package ch.trackedbean.validator;

/**
 * Configuration object for a {@link IPropertyValidator}.
 * 
 * @author M. Hautle
 */
public interface IPropertyValidatorConfiguration {
    /**
     * Returns the configuration attribute as string value.
     * 
     * @param name The name of the value
     * @return The value or null
     */
    Object getObject(String name);

    /**
     * Returns the configuration attribute as string value.
     * 
     * @param name The name of the value
     * @param undefined Value for an undefined entry
     * @return The value
     */
    String getString(String name, String undefined);

    /**
     * Returns the configuration attribute as boolean value.
     * 
     * @param name The name of the value
     * @param undefined Value for an undefined entry
     * @return The value
     */
    boolean getBoolean(String name, boolean undefined);

    /**
     * Returns the configuration attribute as integer value.
     * 
     * @param name The name of the value
     * @param undefined Value for an undefined entry
     * @return The value
     */
    int getInt(String name, int undefined);

    /**
     * Returns the configuration attribute as long value.
     * 
     * @param name The name of the value
     * @param undefined Value for an undefined entry
     * @return The value
     */
    long getLong(String name, long undefined);

    /**
     * Returns the configuration attribute as double value.
     * 
     * @param name The name of the value
     * @param undefined Value for an undefined entry
     * @return The value
     */
    double getDouble(String name, double undefined);

    /**
     * Returns the configuration attribute as {@link Number}.
     * 
     * @param name The name of the value
     * @param undefined Value for an undefined entry
     * @return The value
     */
    Number getNumber(String name, Number undefined);

    /**
     * Returns the class for which this validation configuration applies.
     * 
     * @return The class on which the validation is applied
     */
    Class getConcernedClass();
}
